﻿namespace HQS.TokenInterpolation.Tokens
{
    [Token(Name = "substring")]
    public class SubString : AbstractToken
    {
        [TokenProperty("this", true)]
        public string This { get; set; }

        [TokenProperty("length", false)]
        public int Length { get; set; }

        [TokenProperty("from", false)]
        public int From { get; set; }

        protected override TokenRuntimeValue OnAccept(IDataSourcesVisitor dataSourcesVisitor)
        {
            return dataSourcesVisitor.Visit(this);
        }
    }
}